<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
{template index/header}
	<div class="container containerUser fix pt15">
		{template member/slide}
		<div class="userRight">
			<div class="userTitle mgb10">
              会员管理
        	</div> 
        	<div class="userMain mgb10 agentMember">
              	<div class="searchOpt">
                	账号：<input type="text" name="username" id="id_username" class="userInput w90" value="{$user_name}"> &nbsp; 
                	用户类型：
                  	<select class ="selectBox" name="usertype" id="id_usertype">
                    	<option value="0">全部</option> 
        	        	<option value="1" {if $user_type == 1} selected="selected" {/if}>代理</option> 
        	        	<option value="2" {if $user_type == 2} selected="selected" {/if}>玩家</option>
                  	</select>
                	<a class="submitBtn" id="id_submitBtn">搜索</a>
            	</div> 
        		<div class="accountDetail">
        			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="ty_table3">
        				<tbody>
        					<tr>
        						<th>账号</th> 
        						<th>用户类型</th> 
        						<th>下级人数</th> 
        						<th>余额</th> 
        						<th>最后登录</th> 
        						<th>操作</th>
        					</tr>
        				</tbody> 
        				<tbody id="fudetail_list">
        					{if $data}
        						{loop $data as $k => $v}
            						<tr>
            							<td>{$v['username']}</td>
            							<td>{if $v['user_type'] == 1}代理{else}玩家{/if}</td>
            							<td>{$v['lower_nums']}</td>
            							<td>{$v['money']}</td>
            							<td>{date('Y-m-d H:i:s', $v['last_time'])}</td>
            							<td>
            								<div class="manage">
            									<a title="投注明细" href="{U('member/agentBetRecord', array('username'=>$v['username']))}">
            										<i class="iconfont"></i>
            									</a> 
            									<a title="交易明细" href="{U('member/agentBillRecord', array('tag_uid'=>$v['id']))}">
            										<i class="iconfont"></i>
            									</a> 
            									<a title="查看返点" ami="{$v['inv_uid']}" amv="{$v['inv_id']}" class="tag_see_rps">
            										<i class="iconfont"></i>
            									</a>
            								</div>
            							</td>
            						</tr>
        						{/loop}
        					{else}
            					<tr style="border-bottom: 0px;">
            						<td colspan="100">
            							<div class="notContent" style="padding: 100px 0px;"><i class="iconfont"></i>暂无记录</div>
            						</td>
            					</tr>  
        					{/if}
        				</tbody>
        			</table> 
        			<div class="page">
        				<p>共<em>{$tmp['p']}</em>条记录</p> 
        				<div id="pageNav" class="pageNav">
        					{$multi}
        				</div>
        			</div>
        		</div>
        	</div>
		</div>
		<div class="_div" style="display: none;" id="id_show_rps">
   			<div class="layerBg"></div> 
                <div id="layui-layer4" type="page" times="4" showtime="0" contype="string" class="layui-layer layui-layer-page  layer-anim" style="z-index: 19891018; width: 650px; height: 500px; top: 256.5px; left: 307px;">
                 	<div move="ok" class="layui-layer-title" style="cursor: move;">详情</div> 
                 	<div id="" class="layui-layer-content" style="height: 450px;">
                      	<div id="Detail" class="bonusTable" style="padding: 0px;">
                           	{loop $cateList as $k => $v}
        						<ul class="InviteW">
                                	<li>{$v['name']}</li> 
                                    <li>
                                    	<input type="text" name="" disabled="disabled" class="userInput mgl20" id="id_invcode_item_{$v['id']}" />&nbsp;
                                    	<span>（自身返点：{$rpsInfo[$k]['re_point']}）</span>
                                    </li>
                               	</ul>
        					{/loop}
                      	</div>
                 	</div> 
                 	<span class="layui-layer-setwin"><a href="javascript:;" class="close" id="id_close_showbox"></a></span>
            	</div>
           </div>
		</div>
	<script src="static/js/member/member_common_func.js"></script>
	<script>
		$('#id_submitBtn').on('click', '', function (){
			var username = $('#id_username').val();
			var usertype = $('#id_usertype').val();
			if(!username && usertype == 0) return;
			var param = '';
			if(username) param  = 'username=' + username;
			if(usertype) param += param ? '&':'' + 'usertype=' + usertype;
			window.location = "{U('member/agentMember')}&" + param;
		})
		var type    = '';
		var resData = '';	
		$('.tag_see_rps').on('click', '', function (){
			var param   = {'operation':'getRpsByUid', 'type':type, 'uid':$(this).attr('ami')};
			getData("{U('json/func_member')}", param);
			var detail = resData[$(this).attr('amv')].item;
			$('#id_invcode_detail').show();
			for(var i = 0; i < detail.length; i++){
				$('#id_invcode_item_' + detail[i].lott_cate_id).val(detail[i].re_point);
			}
			$('#id_show_rps').show();
		})
		$('#id_close_showbox').on('click', '', function (){
			$('#id_show_rps').hide();
		})
	</script>
{template index/footer}